﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.IO;
using System.Drawing.Imaging;
using System.Data.SqlClient;
using System.Configuration;
using System.Data.Sql;
using System.Data.SqlTypes;
using System.Web.SessionState;
using System.ComponentModel;
using System.Data;
using System.Web.UI.HtmlControls;

namespace iResume
{
    public partial class Updatejscontact : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                loctxb.Focus();

                ArrayList jsUpdate = new ArrayList();
                string email = (string)(Session["username"]);

                if (email == null)
                {
                    Response.Redirect("loginpage.aspx");
                }

                jsUpdate = DBManager.retrievejscontact(email);
                JobSeeker Update = new JobSeeker();
                Update = (JobSeeker)jsUpdate[0];

                loctxb.Text = Update.Location;
                phonetxb.Text = Update.Phone;
                emailtxb.Text = Update.Contactemail;
              



            }
        }

        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            string username = (string)(Session["username"]);
            string location = loctxb.Text;
            string phone = phonetxb.Text;
            string email = emailtxb.Text;
          


            JobSeeker js = new JobSeeker(location,email,phone,username);
            DBManager.updateJscontact(js);

            loctxb.Text = "";
            phonetxb.Text = "";
            emailtxb.Text = "";
       


            Response.Redirect("jscontact.aspx");
        }
    }
}